package com.example.demo.mapper;


import com.example.demo.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserMap {

    User getUser(int id);

   List<User>  getUserByLogin(String username);

    int SaveUser(User user);

    void UpdateUserNickName(@Param("id") int id, @Param("nickname") String nickname);

    void DeleteUserById(int id);

    List<User> GetUserList();
    void UpdateUser(User user);

    List<User> SearchUserListByALL(String name,String role);
    List<User> SearchUserListByName(String name);
    List<User> SearchUserListByRole(String role);

    int CountTeacher();
    int CountStudent();


    void UpdateUserAvatar(int id,String imgPath);
    String   GetUserAvatar(int id);
}
